using System;

namespace InventorySystem
{
    // 背包操作枚举类型
    public enum InventoryOperation
    {
        Add,// 添加物品
        Remove// 移除物品
    }

    // 背包异常类
    public class InventoryException : Exception
    {
        public InventoryOperation Operation { get; }// 引发异常时的背包操作
        public InventoryException(InventoryOperation operation, string msg) : base($"{operation} Error: {msg}")// 构造函数
        {
            Operation = operation;
        }
    }
}